UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w1YgyyruPtchUVY1d4cU8qGgw4PEzofDxwCO4i2/510=' 
WHERE 
  key_id = 'ca8ff9d1540e755205c7d1562c7ae3ee5f6d9ab97bf2a268847ab67be94cf912' 
  AND (
    token = 'w1YgyyruPtchUVY1d4cU8qGgw4PEzofDxwCO4i2/510=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024