UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZVEKdAqJ2Oj61g8xxMiATu+8dW6YIwod7cO8zHwDtw='
WHERE
key_id = '5e64c6d22af6688d63efed81f927eeccd8ab43781c923ccccb363e6fa51d5342'
AND (
token = '8ZVEKdAqJ2Oj61g8xxMiATu+8dW6YIwod7cO8zHwDtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)