UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zys22Qkxn0tyDzk5JATl3WV9/1TbyFpfa9oAJaRcfbs=' 
WHERE 
  key_id = 'a662fddfb58f38d46a45a9e731b47b9bd008e40d3f3f852ed7ae90fb3ae25cfe' 
  AND (
    token = 'zys22Qkxn0tyDzk5JATl3WV9/1TbyFpfa9oAJaRcfbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057