UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g+XiqHnKY2DTfssDdcbTqbth8q73z27QUZnpMXF2jI0='
WHERE
key_id = 'b9bc152c35d762d1d5e03c947347442c8f7534be1dba1ce87e3fb86264db15a4'
AND (
token = 'g+XiqHnKY2DTfssDdcbTqbth8q73z27QUZnpMXF2jI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)