UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EyN3fTaEKFIKuOPYkfS8U6HyaoxIayDq0OkiucvRjkc='
WHERE
key_id = '18d397727c55606b78bf3563a47537efc134e0cea992470054ed52bc5da5e1ba'
AND (
token = 'EyN3fTaEKFIKuOPYkfS8U6HyaoxIayDq0OkiucvRjkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)