UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6YD1IB4dsTyb4WkwOoYjNnqojNbFTRD4n+Y64Eu0PTs='
WHERE
key_id = '2e8f5d9204f6155939ec281b97720594b6823c12b05bf1575adfb836eaafe1a1'
AND (
token = '6YD1IB4dsTyb4WkwOoYjNnqojNbFTRD4n+Y64Eu0PTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)