UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oc2DaAVKg1Ey3PUtWH+lYwLg5+b3lAJcJ7NrGZP4vYY='
WHERE
key_id = '7c19e0bb74871c23522335bc5883379fa80cff6252f2811c72273618bb3f2573'
AND (
token = 'Oc2DaAVKg1Ey3PUtWH+lYwLg5+b3lAJcJ7NrGZP4vYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)