UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DW9H8sfk8JLIXUeGGrC+gNqPFruQrTiBYunadH1Fb4E=' 
WHERE 
  key_id = '535a758e5645c1ef411a1fd60fa672ca0fe770dd566f14a14f7772bbf195c11c' 
  AND (
    token = 'DW9H8sfk8JLIXUeGGrC+gNqPFruQrTiBYunadH1Fb4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030