UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LYywO/uUj/GX0Z2dQNi2T/tHeQFir37n1yiB1jnhvoA='
WHERE
key_id = '4e5174b550485206c2083414cbee5a9befcdebc93340d8a217fbb49a725f4566'
AND (
token = 'LYywO/uUj/GX0Z2dQNi2T/tHeQFir37n1yiB1jnhvoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)