UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bIrmHZZzARCJ+ORBgFBaeBtGM4MylfzGJX2ChwmXQqQ=' 
WHERE 
  key_id = 'd4267f3e75e381447e1672656d6720d844a64004d79959d630b531c2d7d88c59' 
  AND (
    token = 'bIrmHZZzARCJ+ORBgFBaeBtGM4MylfzGJX2ChwmXQqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033