UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mHEOudcUNz8w9npSupmwUzybeo6QZMOQ+3sYwV6vwfY=' 
WHERE 
  key_id = '260e1002de8cd93594f952e844c8e0e1ea9173ae33754bfef514182b12ddad82' 
  AND (
    token = 'mHEOudcUNz8w9npSupmwUzybeo6QZMOQ+3sYwV6vwfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018