UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AsQOQxj1/QLVzGWylw51OZ8C+hqm4tYI+PY7LM9SzUY=' 
WHERE 
  key_id = '8922950febc0b5eca32935b808bc874e61623da00dfc9de0fa94fcdc67f0b630' 
  AND (
    token = 'AsQOQxj1/QLVzGWylw51OZ8C+hqm4tYI+PY7LM9SzUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026