UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NZ4fX/fr6JxK8bNMGhXo6rPikpwAUsjdKlJN/4c3UgA='
WHERE
key_id = 'bd34e99842143c3e76885432a186a7cb27893287bf5f485cb4245bd9cc6f0d4f'
AND (
token = 'NZ4fX/fr6JxK8bNMGhXo6rPikpwAUsjdKlJN/4c3UgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)