UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vj/tUjRpSEV/M5SICWT7K8b/uXQJiS3gsKIcXOKP+pk='
WHERE
key_id = '1fb350447fc51e193fe9dcd815fc5e95cffc995547e4cc7ff9b5eaa9f3db91eb'
AND (
token = 'vj/tUjRpSEV/M5SICWT7K8b/uXQJiS3gsKIcXOKP+pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)