UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kgToqz3/sKXrXaqyzMdtN+nyLru1HEvtz8+TKBaSzXg='
WHERE
key_id = '7ab0665039ea8bca289b2b446a65ce4efd14ecee6f69e8d20a8d5b6e71e72a68'
AND (
token = 'kgToqz3/sKXrXaqyzMdtN+nyLru1HEvtz8+TKBaSzXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)