UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Edl1shCTSAG4aIT66WpnH0WkodvqlW/zYee6179ofsY=' 
WHERE 
  key_id = '920a0b4f6cce053f05fcdcbd891359dfb6453eb61c332ae15c554a8b455065e6' 
  AND (
    token = 'Edl1shCTSAG4aIT66WpnH0WkodvqlW/zYee6179ofsY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021