UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zZdpFCfw358/I0Gcpynqp4Bt6EyBj4eZa/lq4AlLJPM=' 
WHERE 
  key_id = 'b81d7e073d20518b83bded3062515fedf4a71adae4ac7c757a476cf5edb94747' 
  AND (
    token = 'zZdpFCfw358/I0Gcpynqp4Bt6EyBj4eZa/lq4AlLJPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023