UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qZXI/nU0W//0b8U3fISeBBfC+8vQ7ko9GSoe+3M4j6o=' 
WHERE 
  key_id = '79ffc2f3a6ce18c9a0c8f8876431208b18d2ac0ef56ec5bebccf2a14b4f1ee94' 
  AND (
    token = 'qZXI/nU0W//0b8U3fISeBBfC+8vQ7ko9GSoe+3M4j6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035