UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfENo8JqowyBlKp9wUVZ0oqo5tbVo0ErFqgcSpHj4h0='
WHERE
key_id = '0714b116dac7de60456e8c70420b4229766e0d9a3ae16d630df576b914746903'
AND (
token = 'rfENo8JqowyBlKp9wUVZ0oqo5tbVo0ErFqgcSpHj4h0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)