UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kUeACCZTO9Lzp0zFBnwpZuBAjOhntRYzhtcT3Rv0XNU='
WHERE
key_id = '21fa34f038b672b393599f40a21b878a8aab2245c592068e32b0fd717e9101c3'
AND (
token = 'kUeACCZTO9Lzp0zFBnwpZuBAjOhntRYzhtcT3Rv0XNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)