UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DdT2xQVjiOjAhIi1nusn9FZtfncJEhPY/Son3vs/fZg='
WHERE
key_id = '8926efc292cfbf4a30b695cae1df8fea25d718513fef1259834e29983aa196df'
AND (
token = 'DdT2xQVjiOjAhIi1nusn9FZtfncJEhPY/Son3vs/fZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)