UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YuEmyRZqwwM3zRK+UE24leAoxLsOXXOjTILQcDTGF2k=' 
WHERE 
  key_id = '208ec0cf0fbcd958c18a90818b151057bc76930ea5ba3a0d5d779d23655f27cf' 
  AND (
    token = 'YuEmyRZqwwM3zRK+UE24leAoxLsOXXOjTILQcDTGF2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026