UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yz3ce+4FehJpyo9yuWDgmnb46Fc/69Q/jWk5UU1/ylY='
WHERE
key_id = 'ae4e15f4cb69a29a12a6163f2affc0aec3db96c1d4469a98abca5fbb95285188'
AND (
token = 'yz3ce+4FehJpyo9yuWDgmnb46Fc/69Q/jWk5UU1/ylY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)