UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MqlSbTRZ1HN5fqIh0pampxQyd7x8UGMSbOYbX6BZCxU=' 
WHERE 
  key_id = '1cf564eb0275c47b5fce2890561c431d9a5398edab93db52dd0027c61dda2084' 
  AND (
    token = 'MqlSbTRZ1HN5fqIh0pampxQyd7x8UGMSbOYbX6BZCxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031