UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBiDERa5XZLhr20Iq5aJFRiSa4kLIMkogb2WtXdNFEA=' 
WHERE 
  key_id = '7fa2c99d1db0ceba6ae3b0f71e55c624f8ee314f85dc002062ea70d49c32bb9f' 
  AND (
    token = 'MBiDERa5XZLhr20Iq5aJFRiSa4kLIMkogb2WtXdNFEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058