UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cfrfXRXQ29JLmtcxL1g1CDrAjdHDMCKWM3RumFZCqNI='
WHERE
key_id = '89e70b314e49983e2b3cc2b34953fefad41a8672a487cf844def898ed77485f8'
AND (
token = 'cfrfXRXQ29JLmtcxL1g1CDrAjdHDMCKWM3RumFZCqNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)