UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNFrsvf/hNdzzPDh9lo3qvWAfUDVHK5WNK/18Z/MPDY=' 
WHERE 
  key_id = '32ccbe585ffdb667e06713aa00686ce5070075869e49d48e88792c2aebd5a843' 
  AND (
    token = 'GNFrsvf/hNdzzPDh9lo3qvWAfUDVHK5WNK/18Z/MPDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032