UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hin2fu6xNBdIowpn9zvxKlw5Nk8+UxQgRGf7OmedcR8='
WHERE
key_id = '272297bc74d85782132b89fa2bbd6cec51160b738a04d6ddfb000499f7d29aed'
AND (
token = 'Hin2fu6xNBdIowpn9zvxKlw5Nk8+UxQgRGf7OmedcR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)