UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4jv0opN1qu0SPca//UJ8tKAo4UbppG8ioBYm9wkeMMI='
WHERE
key_id = '89a2741dbf809c9ecd014633a69e8f514a1575a507c847107d923e6ab58e3e84'
AND (
token = '4jv0opN1qu0SPca//UJ8tKAo4UbppG8ioBYm9wkeMMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)