UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zr0DqAWqkRGe8oEukxDPu+SNJhC82cdG1JTwYOMaJ8I=' 
WHERE 
  key_id = '707d5550bde91f8f81789d4ada6a55d230384caaad4de7951daf7f9ce501a98b' 
  AND (
    token = 'zr0DqAWqkRGe8oEukxDPu+SNJhC82cdG1JTwYOMaJ8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024