UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/rxGGZ+J03DUTTs6Zg/MkKHp6p/hA9Gpjw428YkbhCg='
WHERE
key_id = '12ac41229d23603a373dd798f48f042617aeebe0e382ed15397623ddb8ae219e'
AND (
token = '/rxGGZ+J03DUTTs6Zg/MkKHp6p/hA9Gpjw428YkbhCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)