UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wQBNCmzZR+PPoopymtbNKHQczf6cqXNaXco8hI9GZAc='
WHERE
key_id = '5ee9bdde0b13a1b7d00797d5322cc6451b38253d2af5a4d28073c51d34c4dc41'
AND (
token = 'wQBNCmzZR+PPoopymtbNKHQczf6cqXNaXco8hI9GZAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)